﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Person.aspx.cs" Inherits="Person" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:ListView ID="ListView1" runat="server" DataKeyNames="ssn" 
            DataSourceID="AccessDataSource1" InsertItemPosition="LastItem">
            <AlternatingItemTemplate>
                <tr style="background-color:#FFF8DC;">
                    <td>
                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                            Text="Delete" />
                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" 
                            Text="Edit" />
                    </td>
                    <td>
                        <asp:Label ID="ssnLabel" runat="server" Text='<%# Eval("ssn") %>' />
                    </td>
                    <td>
                        <asp:Label ID="p_fnameLabel" runat="server" Text='<%# Eval("p_fname") %>' />
                    </td>
                    <td>
                        <asp:Label ID="p_lnameLabel" runat="server" Text='<%# Eval("p_lname") %>' />
                    </td>
                    <td>
                        <asp:Label ID="p_birthDateLabel" runat="server" 
                            Text='<%# Eval("p_birthDate") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_zipLabel" runat="server" Text='<%# Eval("a_zip") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_cityLabel" runat="server" Text='<%# Eval("a_city") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_stateLabel" runat="server" Text='<%# Eval("a_state") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_strnameLabel" runat="server" Text='<%# Eval("a_strname") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_strnumbLabel" runat="server" Text='<%# Eval("a_strnumb") %>' />
                    </td>
                </tr>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <tr style="background-color:#008A8C;color: #FFFFFF;">
                    <td>
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                            Text="Update" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Cancel" />
                    </td>
                    <td>
                        <asp:Label ID="ssnLabel1" runat="server" Text='<%# Eval("ssn") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="p_fnameTextBox" runat="server" Text='<%# Bind("p_fname") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="p_lnameTextBox" runat="server" Text='<%# Bind("p_lname") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="p_birthDateTextBox" runat="server" 
                            Text='<%# Bind("p_birthDate") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="a_zipTextBox" runat="server" Text='<%# Bind("a_zip") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="a_cityTextBox" runat="server" Text='<%# Bind("a_city") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="a_stateTextBox" runat="server" Text='<%# Bind("a_state") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="a_strnameTextBox" runat="server" 
                            Text='<%# Bind("a_strname") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="a_strnumbTextBox" runat="server" 
                            Text='<%# Bind("a_strnumb") %>' />
                    </td>
                </tr>
            </EditItemTemplate>
            <EmptyDataTemplate>
                <table runat="server" 
                    style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                    <tr>
                        <td>
                            No data was returned.</td>
                    </tr>
                </table>
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <tr style="">
                    <td>
                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                            Text="Insert" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Clear" />
                    </td>
                    <td>
                        <asp:TextBox  ID="ssnTextBox" runat="server" Text='<%# Bind("ssn") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="p_fnameTextBox" runat="server" Text='<%# Bind("p_fname") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="p_lnameTextBox" runat="server" Text='<%# Bind("p_lname") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="p_birthDateTextBox" runat="server" 
                            Text='<%# Bind("p_birthDate") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="a_zipTextBox" runat="server" Text='<%# Bind("a_zip") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="a_cityTextBox" runat="server" Text='<%# Bind("a_city") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="a_stateTextBox" runat="server" Text='<%# Bind("a_state") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="a_strnameTextBox" runat="server" 
                            Text='<%# Bind("a_strname") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="a_strnumbTextBox" runat="server" 
                            Text='<%# Bind("a_strnumb") %>' />
                    </td>
                </tr>
            </InsertItemTemplate>
            <ItemTemplate>
                <tr style="background-color:#DCDCDC;color: #000000;">
                    <td>
                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                            Text="Delete" />
                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" 
                            Text="Edit" />
                    </td>
                    <td>
                        <asp:Label ID="ssnLabel" runat="server" Text='<%# Eval("ssn") %>' />
                    </td>
                    <td>
                        <asp:Label ID="p_fnameLabel" runat="server" Text='<%# Eval("p_fname") %>' />
                    </td>
                    <td>
                        <asp:Label ID="p_lnameLabel" runat="server" Text='<%# Eval("p_lname") %>' />
                    </td>
                    <td>
                        <asp:Label ID="p_birthDateLabel" runat="server" 
                            Text='<%# Eval("p_birthDate") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_zipLabel" runat="server" Text='<%# Eval("a_zip") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_cityLabel" runat="server" Text='<%# Eval("a_city") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_stateLabel" runat="server" Text='<%# Eval("a_state") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_strnameLabel" runat="server" Text='<%# Eval("a_strname") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_strnumbLabel" runat="server" Text='<%# Eval("a_strnumb") %>' />
                    </td>
                </tr>
            </ItemTemplate>
            <LayoutTemplate>
                <table runat="server">
                    <tr runat="server">
                        <td runat="server">
                            <table ID="itemPlaceholderContainer" runat="server" border="1" 
                                style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                                <tr runat="server" style="background-color:#DCDCDC;color: #000000;">
                                    <th runat="server">
                                    </th>
                                    <th runat="server">
                                        ssn</th>
                                    <th runat="server">
                                        p_fname</th>
                                    <th runat="server">
                                        p_lname</th>
                                    <th runat="server">
                                        p_birthDate</th>
                                    <th runat="server">
                                        a_zip</th>
                                    <th runat="server">
                                        a_city</th>
                                    <th runat="server">
                                        a_state</th>
                                    <th runat="server">
                                        a_strname</th>
                                    <th runat="server">
                                        a_strnumb</th>
                                </tr>
                                <tr ID="itemPlaceholder" runat="server">
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr runat="server">
                        <td runat="server" 
                            style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                            <asp:DataPager ID="DataPager1" runat="server">
                                <Fields>
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                        ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                    <asp:NumericPagerField />
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                        ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                </Fields>
                            </asp:DataPager>
                        </td>
                    </tr>
                </table>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <tr style="background-color:#008A8C;font-weight: bold;color: #FFFFFF;">
                    <td>
                        <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                            Text="Delete" />
                        <asp:Button ID="EditButton" runat="server" CommandName="Edit" 
                            Text="Edit" />
                    </td>
                    <td>
                        <asp:Label ID="ssnLabel" runat="server" Text='<%# Eval("ssn") %>' />
                    </td>
                    <td>
                        <asp:Label ID="p_fnameLabel" runat="server" Text='<%# Eval("p_fname") %>' />
                    </td>
                    <td>
                        <asp:Label ID="p_lnameLabel" runat="server" Text='<%# Eval("p_lname") %>' />
                    </td>
                    <td>
                        <asp:Label ID="p_birthDateLabel" runat="server" 
                            Text='<%# Eval("p_birthDate") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_zipLabel" runat="server" Text='<%# Eval("a_zip") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_cityLabel" runat="server" Text='<%# Eval("a_city") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_stateLabel" runat="server" Text='<%# Eval("a_state") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_strnameLabel" runat="server" Text='<%# Eval("a_strname") %>' />
                    </td>
                    <td>
                        <asp:Label ID="a_strnumbLabel" runat="server" Text='<%# Eval("a_strnumb") %>' />
                    </td>
                </tr>
            </SelectedItemTemplate>
        </asp:ListView>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
            ConflictDetection="OverwriteChanges" 
            DataFile="~/App_Data/ForestryEnterprise.mdb" 
            DeleteCommand="DELETE FROM [Person] WHERE [ssn] = ? AND (([p_fname] = ?) OR ([p_fname] IS NULL AND ? IS NULL)) AND (([p_lname] = ?) OR ([p_lname] IS NULL AND ? IS NULL)) AND (([p_birthDate] = ?) OR ([p_birthDate] IS NULL AND ? IS NULL)) AND (([a_zip] = ?) OR ([a_zip] IS NULL AND ? IS NULL)) AND (([a_city] = ?) OR ([a_city] IS NULL AND ? IS NULL)) AND (([a_state] = ?) OR ([a_state] IS NULL AND ? IS NULL)) AND (([a_strname] = ?) OR ([a_strname] IS NULL AND ? IS NULL)) AND (([a_strnumb] = ?) OR ([a_strnumb] IS NULL AND ? IS NULL))" 
            InsertCommand="INSERT INTO [Person] ([ssn], [p_fname], [p_lname], [p_birthDate], [a_zip], [a_city], [a_state], [a_strname], [a_strnumb]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)" 
            OldValuesParameterFormatString="original_{0}" 
            SelectCommand="SELECT * FROM [Person]" 
            UpdateCommand="UPDATE [Person] SET [p_fname] = ?, [p_lname] = ?, [p_birthDate] = ?, [a_zip] = ?, [a_city] = ?, [a_state] = ?, [a_strname] = ?, [a_strnumb] = ? WHERE [ssn] = ? AND (([p_fname] = ?) OR ([p_fname] IS NULL AND ? IS NULL)) AND (([p_lname] = ?) OR ([p_lname] IS NULL AND ? IS NULL)) AND (([p_birthDate] = ?) OR ([p_birthDate] IS NULL AND ? IS NULL)) AND (([a_zip] = ?) OR ([a_zip] IS NULL AND ? IS NULL)) AND (([a_city] = ?) OR ([a_city] IS NULL AND ? IS NULL)) AND (([a_state] = ?) OR ([a_state] IS NULL AND ? IS NULL)) AND (([a_strname] = ?) OR ([a_strname] IS NULL AND ? IS NULL)) AND (([a_strnumb] = ?) OR ([a_strnumb] IS NULL AND ? IS NULL))">
            <DeleteParameters>
                <asp:Parameter Name="original_ssn" Type="String" />
                <asp:Parameter Name="original_p_fname" Type="String" />
                <asp:Parameter Name="original_p_fname" Type="String" />
                <asp:Parameter Name="original_p_lname" Type="String" />
                <asp:Parameter Name="original_p_lname" Type="String" />
                <asp:Parameter Name="original_p_birthDate" Type="DateTime" />
                <asp:Parameter Name="original_p_birthDate" Type="DateTime" />
                <asp:Parameter Name="original_a_zip" Type="Int32" />
                <asp:Parameter Name="original_a_zip" Type="Int32" />
                <asp:Parameter Name="original_a_city" Type="String" />
                <asp:Parameter Name="original_a_city" Type="String" />
                <asp:Parameter Name="original_a_state" Type="String" />
                <asp:Parameter Name="original_a_state" Type="String" />
                <asp:Parameter Name="original_a_strname" Type="String" />
                <asp:Parameter Name="original_a_strname" Type="String" />
                <asp:Parameter Name="original_a_strnumb" Type="Int32" />
                <asp:Parameter Name="original_a_strnumb" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="ssn" Type="String" />
                <asp:Parameter Name="p_fname" Type="String" />
                <asp:Parameter Name="p_lname" Type="String" />
                <asp:Parameter Name="p_birthDate" Type="DateTime" />
                <asp:Parameter Name="a_zip" Type="Int32" />
                <asp:Parameter Name="a_city" Type="String" />
                <asp:Parameter Name="a_state" Type="String" />
                <asp:Parameter Name="a_strname" Type="String" />
                <asp:Parameter Name="a_strnumb" Type="Int32" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="p_fname" Type="String" />
                <asp:Parameter Name="p_lname" Type="String" />
                <asp:Parameter Name="p_birthDate" Type="DateTime" />
                <asp:Parameter Name="a_zip" Type="Int32" />
                <asp:Parameter Name="a_city" Type="String" />
                <asp:Parameter Name="a_state" Type="String" />
                <asp:Parameter Name="a_strname" Type="String" />
                <asp:Parameter Name="a_strnumb" Type="Int32" />
                <asp:Parameter Name="original_ssn" Type="String" />
                <asp:Parameter Name="original_p_fname" Type="String" />
                <asp:Parameter Name="original_p_fname" Type="String" />
                <asp:Parameter Name="original_p_lname" Type="String" />
                <asp:Parameter Name="original_p_lname" Type="String" />
                <asp:Parameter Name="original_p_birthDate" Type="DateTime" />
                <asp:Parameter Name="original_p_birthDate" Type="DateTime" />
                <asp:Parameter Name="original_a_zip" Type="Int32" />
                <asp:Parameter Name="original_a_zip" Type="Int32" />
                <asp:Parameter Name="original_a_city" Type="String" />
                <asp:Parameter Name="original_a_city" Type="String" />
                <asp:Parameter Name="original_a_state" Type="String" />
                <asp:Parameter Name="original_a_state" Type="String" />
                <asp:Parameter Name="original_a_strname" Type="String" />
                <asp:Parameter Name="original_a_strname" Type="String" />
                <asp:Parameter Name="original_a_strnumb" Type="Int32" />
                <asp:Parameter Name="original_a_strnumb" Type="Int32" />
            </UpdateParameters>
        </asp:AccessDataSource>


    
    </div>
    </form>
</body>
</html>
